import Vue from 'vue'
import Router from 'vue-router'
/* 引入hello文件 */
import h from '@/components/test/hello'
import world from '../components/test/world.vue'
import error from '../components/test/error.vue'
import ajax from '../components/test/testAjax.vue'
import emaiLogin from '../components/exam/emailLogin.vue'
import index from '../components/exam/index.vue'
import question from '../components/exam/question.vue'
import testWs from '../components/test/testWebsocket.vue'
import paperAdd from '../components/exam/paperAdd.vue'
import paperExam from '../components/exam/paperExam.vue'

Vue.use(Router)

export default new Router({
  mode:"history",
  routes: [
   {
      path: '/hello',
      name: 'h',
      component: h
    },
    {
       path: '/world',
       name: 'world',
       component: world
     },
     {
        path: '*',//通配所有错误地址
        name: 'error',
        component: error
      },
      {
         path: '/ajax',
         name: 'ajax',
         component: ajax
       },
       {
          path: '/',
          name: 'emaiLogin',
          component: emaiLogin
        },
        {
           path: '/testWs',
           name: 'testWs',
           component: testWs
         },
         {
            path: '/paperExam',
            name: 'paperExam',
            component: paperExam
          },
          {
             path: '/paperAdd',
             name: 'paperAdd',
             component: paperAdd
           },
        {
           path: '/index',
           name: 'index',
           meta:{"isLogin":true},
           component: index,
           children:[
              {
                path: 'question',
                name: 'question',
                meta:{"isLogin":true},
                component: question
              }
           ],

         }
  ]
})
